#pragma once

#include <vector>
#include <string>
#include "CFileRead.h"

#define LINES 10000

using std::cerr;
using std::endl;
using std::ios;
using std::string;
using std::vector;

class CAsciiFileRead : public CFileRead
{

public:
    CAsciiFileRead();                          //
    CAsciiFileRead(string path, int col = 10); // Here col is uselsss
    ~CAsciiFileRead() override;

public:
    void Init() override;
    void Open() override;
    void Load() override; // load 1 line
    void loadAll() override;

public:                   // to use this method , static_cast can be used to transfer ptr(p_base->p_son)
    void skipLines(int lines);  // without loading sth to var

public:
    vector<double> getLineBuf();
    int getcolumns();

private:
    vector<string> splitString(const char delim = ' ');

private:
    int m_columns;
    string m_strLine;
    vector<string> m_LineStringBuf;
    vector<double> m_lineDoubleBuf;
    vector<vector<double>> m_allLinesDoubleBuf;
    // CFileRead *p;
};
